#line 1 "C:/Users/Maxime/Documents/Progc/18f2520/testpwm.c"
#line 13 "C:/Users/Maxime/Documents/Progc/18f2520/testpwm.c"
unsigned short current_duty2, pourcent ;
void train1000(void);
void train200(void);
void train100(void);

void main() {

 TRISA = 0b00000000;
 TRISB = 0b00000000;
 TRISC = 0b00001111;
#line 38 "C:/Users/Maxime/Documents/Progc/18f2520/testpwm.c"
 do {

 train100 ();
 train200 ();
#line 85 "C:/Users/Maxime/Documents/Progc/18f2520/testpwm.c"
 } while(1);
}
void train1000 (void){
 const unsigned long delay = 1000;
  PORTB.RB5  = 1;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 1;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 1;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 1;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 1;
 Delay_ms (delay);


}
void train200 (void){
 const unsigned long delay = 200;
  PORTB.RB5  = 1;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 1;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 1;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 1;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 1;
 Delay_ms (delay);


}
void train100 (void){
 const unsigned long delay = 100;
  PORTB.RB5  = 1;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 1;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 1;
  PORTB.RB2  = 0;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 1;
  PORTB.RB1  = 0;
 Delay_ms (delay);

  PORTB.RB5  = 0;
  PORTB.RB4  = 0;
  PORTB.RB3  = 0;
  PORTB.RB2  = 0;
  PORTB.RB1  = 1;
 Delay_ms (delay);
}
